class Solution
{
public:
    int findMaxK(vector<int> &nums)
    {
        int maxK = -1;
        unordered_set<int> s;
        for (int num : nums)
        {
            if (s.count(-num))
            {
                maxK = max(abs(num), maxK);
            }
            s.insert(num);
        }
        return maxK;
    }
};